home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
DATABASE.DIR
/
00100_Script_CAPTIONS
< prev
next >
Wrap
Text File
|
1996-03-28
|
3KB
|
85 lines
-- --------------------------------------------------------------
-- Handler prepareCaption creates caption fields.
on prepareCaptions firstCast, targetCast
put the text of cast "captionsList" into captionInfo
set numLines = the number of lines in captionInfo
repeat with i = 1 to numLines
set caption = line i of captionInfo
set nextCast = findEmpty(cast targetCast)
put caption into cast nextCast
set nameOld = the name of cast (firstCast + i - 1)
set numChars = the number of chars in nameOld
set shortChars = NumChars - 7
set newName = char 1 to shortChars of nameOld & "CAPTION"
set the name of cast nextCast = newName
end repeat
end
-- --------------------------------------------------------------
-- Handler showPictureCaption
on showTopicPictureCaption
global textSprite, clickedTopic
global captionSprite, captionV, captionH, currentCaption
set captionCast = getCaptionCastNumber(clickedTopic, currentCaption)
set captionText = the text of cast captionCast
-- switch cast members instead of copying text over to preserve
-- the text styles and colors of each field.
if (captionCast = -1) then -- no caption
errorAlert("No caption for" && clickedTopic)
exit
end if
-- setCaptionAttributes(captionCast)
-- show the caption
put captionText into cast the castNum of sprite captionSprite
-- set the castNum of sprite captionSprite = the number of cast captionCast
set the locH of sprite captionSprite = captionH
set the locV of sprite captionSprite = captionV
setFieldFont(captionCast)
end
-- --------------------------------------------------------------
-- Handler removeTopicPictureCaption
on removeTopicPictureCaption
global captionSprite
removeFromStage(captionSprite)
end
-- --------------------------------------------------------------
-- Handler resetCurrentCaption resets the global variable currentCaption
-- to 1. This global variable is used to indicate the caption number
-- of the currently displayed topic (to know what caption
-- number the previous and next captions are for moreUp and moreDown).
on resetCurrentCaption
global currentCaption
set currentCaption = 1
end
-- --------------------------------------------------------------
-- Handler updateCurrentCaption sets the global variable currentCaption
-- to the next caption in the given direction.
on updateCurrentCaption direction
global currentCaption
set currentCaption = currentCaption + direction
end
-- --------------------------------------------------------------
-- Handler setCurrentCaption sets the global variable currentCaption
-- to the caption number of the current topic caption.
on setCurrentCaption -- called from ???
global currentCaption, captionSprite
set currentCaption = value(the last char of the name of cast the castNum of sprite captionSprite)
end